graph = ["digraph{", "rankdir=LR;concentrate=true;"]
ips = []
dests = ["192.100.100.88","192.100.100.1","192.100.100.139","192.100.100.102","192.100.100.100"]
STDIN.readlines[1..-1].each do |line|
	line = line.strip.split(',').map{|x| x[1..-2]}
	if line[6].include? "Who has" and dests.include? line[6][/[0-9]+.[0-9]+.[0-9]+.[0-9]+/]
		ips << '"' + line[6][/[0-9]+.[0-9]+.[0-9]+.[0-9]+$/] + "\" -> \"" + line[6][/[0-9]+.[0-9]+.[0-9]+.[0-9]+/] + '"'
	end
end
graph += ips.sort.uniq
graph << "}"
puts graph.join "\n"